package com.atshiyou.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;

@Controller
public class MyController2 {
    @RequestMapping(value = "/test")
    public String test1(@RequestParam("username") String name, int age, HttpSession session,
                        @CookieValue("JSESSIONID") String sessionid,
                        @RequestHeader("Accept-Language")String language){
        System.out.println("test1被执行");
        System.out.println("username:"+name+",age:"+age);
        session.setAttribute("session",name);
//        System.out.println(5/0);
        System.out.println("cookie:"+sessionid+",language="+language);
        return "success"; //返回的是结果页面的名称
    }
}
